package org.jeecg.modules.online.auth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;

@TableName("onl_auth_page")
@Data
public class OnlAuthPage implements Serializable {
    private static final long serialVersionUID = 1;
    @TableId(type = IdType.ASSIGN_ID)
    private String id;
    //online表id
    private String cgformId;
    //字段名/按钮编码
    private String code;
    //1字段 2按钮
    private Integer type;
    //3可编辑 5可见
    private Integer control;
    //3列表 5表单
    private Integer page;
    //1有效 0无效
    private Integer status;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonIgnore
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;
    @JsonIgnore
    private String createBy;
    @JsonIgnore
    private String updateBy;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonIgnore
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date updateTime;

    public OnlAuthPage setId(String id) {
        this.id = id;
        return this;
    }

    public OnlAuthPage setCgformId(String cgformId) {
        this.cgformId = cgformId;
        return this;
    }

    public OnlAuthPage setCode(String code) {
        this.code = code;
        return this;
    }

    public OnlAuthPage setType(Integer type) {
        this.type = type;
        return this;
    }

    public OnlAuthPage setControl(Integer control) {
        this.control = control;
        return this;
    }

    public OnlAuthPage setPage(Integer page) {
        this.page = page;
        return this;
    }

    public OnlAuthPage setStatus(Integer status) {
        this.status = status;
        return this;
    }

    @JsonIgnore
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    public OnlAuthPage setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    @JsonIgnore
    public OnlAuthPage setCreateBy(String createBy) {
        this.createBy = createBy;
        return this;
    }

    @JsonIgnore
    public OnlAuthPage setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
        return this;
    }

    @JsonIgnore
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    public OnlAuthPage setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }


    public OnlAuthPage() {
    }

    public OnlAuthPage(String cgformId, String code, int page, int control) {
        this.type = 1;
        this.cgformId = cgformId;
        this.code = code;
        this.control = Integer.valueOf(control);
        this.page = Integer.valueOf(page);
        this.status = 1;
    }
}
